bitkeeper revision 1.1515 (42921e4fRcf8j8oxgO4SHlBhn0dSuw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 23 May 2005 18:17:51 +0000 (18:17 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 23 May 2005 18:17:51 +0000 (18:17 +0000)
Better handling of NULL callback pointers -- synchronously crash the
offending domain. This gets us some nice debug output for domain0.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/traps.c
xen/arch/x86/x86_32/entry.S
xen/arch/x86/x86_64/entry.S

index da39f5c9660a25aef61900324cf2887c72c77390..fc2ee40d7b66d1426f7c6fc18132ff3b3bc40f1b 100644 (file)
@@ -245,12 +245,6 @@ static inline int do_trap(int trapnr, char *str,
     if ( !GUEST_MODE(regs) )
         goto xen_fault;
 
-#ifndef NDEBUG
-    if ( (ed->arch.guest_context.trap_ctxt[trapnr].address == 0) &&
-         (ed->domain->domain_id == 0) )
-        goto xen_fault;
-#endif
-
     ti = &current->arch.guest_context.trap_ctxt[trapnr];
     tb->flags = TBF_EXCEPTION;
     tb->cs    = ti->cs;
@@ -450,12 +444,6 @@ asmlinkage int do_page_fault(struct cpu_user_regs *regs)
     if ( !GUEST_MODE(regs) )
         goto xen_fault;
 
-#ifndef NDEBUG
-    if ( (ed->arch.guest_context.trap_ctxt[TRAP_page_fault].address == 0) &&
-         (d->domain_id == 0) )
-        goto xen_fault;
-#endif
-
     propagate_page_fault(addr, regs->error_code);
     return 0; 
 
@@ -932,12 +920,6 @@ asmlinkage int do_general_protection(struct cpu_user_regs *regs)
         return 0;
 #endif
 
-#ifndef NDEBUG
-    if ( (ed->arch.guest_context.trap_ctxt[TRAP_gp_fault].address == 0) &&
-         (ed->domain->domain_id == 0) )
-        goto gp_in_kernel;
-#endif
-
     /* Pass on GPF as is. */
     ti = &current->arch.guest_context.trap_ctxt[TRAP_gp_fault];
     tb->flags      = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
index 1f6f2ff1e844318a29e4115956ad0c5e3e2f09bc..279925a1ce19ce2cbe03e24033e9303e0432b55e 100644 (file)
@@ -331,6 +331,8 @@ FLT13:  movl UREGS_ss+4(%esp),%gs
         movb TRAPBOUNCE_flags(%edx),%cl
         subl $12,%esi
         movl UREGS_eip+4(%esp),%eax
+        test %eax,%eax
+        jz   domain_crash_synchronous
 FLT14:  movl %eax,%gs:(%esi) 
         movl EDOMAIN_vcpu_info(%ebx),%eax
         pushl VCPUINFO_upcall_mask(%eax)
index e10562dc22e18b7ca0c77019e9b7f3389e501bbc..ed2e41dc6fb2d6021f03b0a22e0695e9b8a3a09a 100644 (file)
@@ -320,6 +320,8 @@ FLT4:   movq  %rax,16(%rsi)             # RFLAGS
         movw  UREGS_cs+8(%rsp),%ax      # Bits  0-15: CS
 FLT5:   movq  %rax,8(%rsi)              # CS/saved_upcall_mask
         movq  UREGS_rip+8(%rsp),%rax
+        testq %rax,%rax
+        jz    domain_crash_synchronous
 FLT6:   movq  %rax,(%rsi)               # RIP
         testb $TBF_EXCEPTION_ERRCODE,%cl
         jz    1f